package com.gaogzhen.datastructure.queue;

/**
 * @author Administrator
 * @date 2022-12-04 20:10
 */
public class HeapPQTest {
    public static void main(String[] args) {
        // 最大堆
//        HeapPriorityQueue<Integer> hpq = new HeapPriorityQueue<>(10);
        // 最小堆
        HeapPriorityQueue<String> hpq = new HeapPriorityQueue<>(20, (o1, o2) -> o2.compareTo(o1));
//        System.out.println(hpq.isEmpty());
//        System.out.println(hpq.size());
//        System.out.println(hpq.peek());
        hpq.offer("S");
        hpq.offer("O");
        hpq.offer("R");
        hpq.offer("T");
        hpq.offer("E");
        hpq.offer("X");
        hpq.offer("A");
        hpq.offer("M");
        hpq.offer("P");
        hpq.offer("L");
        hpq.offer("E");
        int size = hpq.size();
        hpq.show();
        System.out.println(size);
//        System.out.println(hpq.peek());

        for (int i = 0; i < size; i++) {
            System.out.println(hpq.poll());
        }
    }
}
